/*
 * This file is part of the xOperator SPARQL/XMPP agent.
 * For further information see: http://xoperator.aksw.org
 * Copyright (C) 2007-2008  Jörg Unbehauen

 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.

 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.

 * You should have received a copy of the GNU General Public License
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */
package org.aksw.xoperator.aiml;

import bitoflife.chatterbean.Match;


/**
 * Abstract class for defining custom listeners for the external tag. the name attribute int the tag must correlate with the name String in the implementing class.
 *
  */
public abstract class ExternalListener {
    String name;

    public ExternalListener(String name) {
        this.name = name;
    }

    /**
     * Returns the name of the Listener, which is used as a discriminator between the different implementations.
     *
     * @return the name of Listener.
     */
    public String getName() {
        return this.name;
    }

    /**
     * Defines what the Listener should do when a match is found.
     *
     * @param match The match of the template.
     * @param param the param parameter of the external tag.
     *
     * @return the string that the template should return to user and the very end of the processing. An empty String is usually fine.
     */
    public abstract String perform(Match match, String param);
}
